home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / Mark Pilgrim / Jotto ][ 1.2 / source / Wipes ƒ / Skipaline L-R.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-10-30  |  1.2 KB  |  40 lines  |  [TEXT/MMCC]

  1. #include "timing.h"
  2.  
  3. #define CorrectTime 1
  4. #define theWindowWidth (boundsRect.right-boundsRect.left)
  5. #define theWindowHeight (boundsRect.bottom-boundsRect.top)
  6.  
  7. pascal short SkipalineLR(GrafPtr sourceGrafPtr, GrafPtr destGrafPtr, Rect boundsRect);
  8.  
  9. /* Copy even-numbered columns starting at the left and moving right, and odd-
  10.    numbered columns starting at the right and moving left.  */
  11.    
  12. pascal short SkipalineLR(GrafPtr sourceGrafPtr, GrafPtr destGrafPtr, Rect boundsRect)
  13. {
  14.     Rect        thisone,thatone;
  15.     Boolean        everyOther=FALSE;
  16.     
  17.     SetRect(&thisone, boundsRect.left, boundsRect.top, boundsRect.left+1, boundsRect.bottom);
  18.     SetRect(&thatone, boundsRect.right-1, boundsRect.top, boundsRect.right, boundsRect.bottom);
  19.     if (theWindowWidth%2)
  20.         OffsetRect(&thatone, -1, 0);
  21.     
  22.     while (thisone.left<boundsRect.right)
  23.     {
  24.         StartTiming();
  25.         CopyBits(&(sourceGrafPtr->portBits), &(destGrafPtr->portBits),
  26.             &thisone, &thisone, 0, 0L);
  27.         CopyBits(&(sourceGrafPtr->portBits), &(destGrafPtr->portBits),
  28.             &thatone, &thatone, 0, 0L);
  29.         thisone.left+=2;      /* left column moves right by 2 */
  30.         thisone.right+=2;
  31.         thatone.left-=2;      /* right column moves left by 2 */
  32.         thatone.right-=2;
  33.         if (everyOther)
  34.             TimeCorrection(CorrectTime);
  35.         everyOther=!everyOther;
  36.     }
  37.     
  38.     return 0;
  39. }
  40.